<template>
  <view class="popup-container">
    <u-popup :show="popupShow" mode="center" round="30">
      <view class="container">
        <view class="title">{{ popupTitle }}</view>
        <view class="day"> <slot name="day"></slot></view>
        <view class="content">
          <slot name="content"></slot>
        </view>
        <view class="bottom" @click="confirmCLick">
          <text>{{ defineButtonText }}</text>
        </view>
        <view class="close" @click="closeClick">
          <u-icon name="close" color="#000" size="20"></u-icon>
        </view>
      </view>
    </u-popup>
  </view>
</template>

<script>
export default {
  props: {
    defineButtonText: {
      default: "确认使用",
    },
    popupTitle: {
      default: "置顶",
      type: String,
    },
  },
  data() {
    return {
      popupShow: false,
    };
  },
  methods: {
    closeClick() {
      this.popupShow = false;
    },
    openClick() {
      this.popupShow = true;
    },
    confirmCLick() {
      this.$emit("confirmClick");
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  width: 700rpx;
  background-color: #fff;
  // height: 600rpx;
  border-radius: 20rpx;
  padding: 20rpx;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  .day {
    margin-top: 20rpx;
  }
  .title {
    font-size: 30rpx;
    font-weight: bold;
  }
  .bottom {
    font-size: 30rpx;
    color: #fff;
    background-color: #4c9ffb;
    text-align: center;
    height: 60rpx;
    width: 500rpx;
    line-height: 60rpx;
    border-radius: 10rpx;
    margin-top: 30rpx;
  }
  .close {
    margin: 20rpx 0;
  }
}
</style>
